// TOWN DIALOGUE SCRIPT
//    Town 0: Magical Grove

// This is the dialogue for this town.
// You can use nodes numbered from 1 to 99.

begintalkscript;

variables;

int i,j,k,choice;

begintalknode 1;
	state = -1;
	personality = 0;
	nextstate = 1;
	condition = 1;
	question = "Vastro";
	text1 = "You meet a massive, alarmingly muscled man, wearing polished armor. He appraises you carefully as you approach.";
	text2 = "_I am Vastro, the only trainer in Magical Grove._";
	text5 = "Vastro the trainer waits to see what you have to say.";
	action = INTRO; 

begintalknode 2;
	state = 1;
	personality = 0;
	nextstate = 2;
	condition = 1;
	question = "What is this place for?";
	text1 = "_I am the trainer for the Grove. I teach people skills so they can survive in the surrounding lands._";

begintalknode 3;
	state = 2;
	personality = 0;
	nextstate = -1;
	condition = 1;
	question = "I would like some training.";
	text1 = "_You will need it. If you have the money and the will, I can tell you what you need to know to survive._";
	text2 = "(You need gold and skill points to improve your skills. To train a character, press the Train button to the right of his or her portrait. You can't train in all towns/dungeons.)";
	text3 = "(Also, some trainers are like shops, in which you can _buy_ skills)";
	code =
	begin_shop_mode("Vastro's Specialised Training","Vastro can teach a wide variety of skills that any adventurer would be proud to learn.",6,5,-1);
	break;


begintalknode 4;
	state = 2;
	personality = 0;
	nextstate = 3;
	condition = 1;
	question = "Tell me more about Magical Grove?";
	text1 = "_That's where you are now. It's a small town, which the Empire and Avernum, working together, simulacrumed, and placed all over the land._";
	text3 = "(What a frightening thought. You might run into Vastro in another strange land!)";


begintalknode 5;
	state = 3;
	personality = 0;
	nextstate = -1;
	condition = 1;
	question = "What is outside?";
	text1 = "_I know not what you will find in the lands surrounding Magical Grove. You may rest assured, however, that they are filled with adventure, treasure, and direst peril._";
	text2 = "_One thing is for sure. You will need my training to help you survive._";

begintalknode 8;
	state = -1;
	personality = 1;
	nextstate = 11;
	condition = 1;
	question = "Rippel";
	text1 = "A lovely woman with delicate features sits behind the counter. She is gluing bright blue feathers on the shafts of iron-tipped arrows.";
	text2 = "_I am known as Rippel the fletcher. Welcome to my shop._";
	text5 = "Rippel is hard at work creating carefully crafted sets of matched arrows.";
	action = INTRO;

begintalknode 9;
	state = 11;
	personality = 1;
	nextstate = 12;
	condition = 1;
	question = "What is your job?";
	text1 = "_I perform the same job I have performed in many strange lands. I create missile weapons of the finest quality. You may purchase them if you like._";

begintalknode 10;
	state = 12;
	personality = 1;
	nextstate = 13;
	condition = 1;
	question = "You've been to strange lands? Like where?";
	text1 = "She sighs. _Before I came to Magical Grove, I practiced my trade in many cities, both on the surface and in Avernum._";

begintalknode 11;
	state = 13;
	personality = 1;
	nextstate = -1;
	condition = 1;
	question = "What cities have you been to?";
	text1 = "_I can hardly remember all the cities I have worked in. All I know is that there will surely be no more for me._";

begintalknode 12;
	state = 11;
	personality = 1;
	nextstate = 11;
	condition = 1;
	question = "I would like to buy some missile weapons.";
	text1 = "You finish shopping.";
	code =
		begin_shop_mode("Rippel's Fletching","Rippel's archery supplies and missile weapons are not of very high quality, but they will function.",3,3,3);
	break;

begintalknode 15;
	state = -1;
	personality = 2;
	nextstate = 21;
	condition = 1;
	question = "Walner";
	text1 = "A heavy set man sits behind the counter, wearing the traditional blue robes of an apprentice mage. The robes show a bit of wear and tear, as if he's been travelling for some time.";
	text2 = "He nods in greeting. _I am called Walner._";
	text5 = "Walner smiles weakly at you, picking nervously at the loose threads of his worn robes. He looks like he could use some sleep.";
	action = INTRO;

begintalknode 16;
	state = 21;
	personality = 2;
	nextstate = 22;
	condition = 1;
	question = "Are you a wizard?";
	text1 = "_Not quite. I have not achieved that lofty title. I am, I'm quite proud to say, a sage with no small experience. Whether in the fields of alchemy or identification, I can be of great assistance to you._";

begintalknode 17;
	state = 22;
	personality = 2;
	nextstate = -1;
	condition = 1;
	question = "You say you have had a lot of experience?";
	text1 = "_Adventures. Wars. Hordes of rampaging demons. I've seen it all._";

begintalknode 18;
	state = 22;
	personality = 2;
	nextstate = -1;
	condition = 1;
	question = "Could you identify my items?";
	text1 = "He looks over your items with a practiced eye. It only takes a moment to figure out what each one is. With a smile, he says _No problem. Each identification will be a mere 10 gold._";
	action = ID 10;

begintalknode 19;
	state = 22;
	personality = 2;
	nextstate = -1;
	condition = 1;
	question = "Can I purchase some potions?";
	text1 = "You finish shopping.";
	code =
		begin_shop_mode("Walner's potions","Walner has sold most of his stock to passing adventurers, but he does has a few useful items left.",4,4,2);
	break;

begintalknode 20;
	state = 21;
	personality = 2;
	nextstate = -1;
	condition = 1;
	question = "You look like you have travelled a long way to be here.";
	text1 = "He sighs. _Yes, I have started to look rather run down. Don't think, because of that, I have nothing to offer. I do have skills, I assure you._";

begintalknode 24;
	state = -1;
	personality = 3;
	nextstate = 31;
	condition = 1;
	question = "Marian";
	text1 = "You interrupt a priestess. She concludes her chanting, turns, and bows to you. The ankh around her neck indicates some proficiency in the healing arts.";
	text2 = "_I am Mariann. Welcome to the Shrine of Divine Health._";
	text5 = "Mariann the healer waits patiently to see if you need assistance.";
	action = INTRO;

begintalknode 25;
	state = 31;
	personality = 3;
	nextstate = 32;
	condition = 1;
	question = "Tell me about this place?";
	text1 = "_The Shrine of Divine Health is dedicated to all of the healing arts. It certainly comes in handy here in Magical Grove._";
	text2 = "_I can fully restore anyone travelling with you for 30 coins. I can heal your wounds, remove the curse from anything nasty you are wearing, and even bring an unfortunate soul back from beyond the wall of death._";
	text3 = "_I can also teach spells to those who wish to learn the more advanced form of healing. However, the prices are not cheap._";

begintalknode 26;
	state = 32;
	personality = 3;
	nextstate = -1;
	condition = 1;
	question = "Someone with me requires healing. (Pay 30 coins.)";
	text1 = "Mariann looks sad. _I would love to help you, even though you don't have money. However, maintaining a shrine like this is expensive._";
	text3 = "_I am glad to hear that none of you needs help after all._";
	text5 = "Mariann kneels and prays fervently. You feel a powerful holy energy fill the shrine. After an hour, the power reaches its apex and, with a flash of light, your friend is restored.";
	code =
		clear_strings();
		if (coins_amount() < 30) 
			add_string(1);
			else if (run_select_a_pc(1) == 0)
				add_string(3);
				else {
					play_sound(24);
					add_string(5);
					restore_pc(get_selected_pc());
					change_coins(-30);
					}
				
	break;

begintalknode 27;
	state = 31;
	personality = 3;
	nextstate = -1;
	condition = 1;
	question = "You are a priestess in the shrine?";
	text1 = "_Yes. We priests and priestesses of healing dedicate ourselves to the restoration of those who fall ill, break bones, are gnawed on by monsters, that sort of thing._";

begintalknode 28;
	state = 32;
	personality = 3;
	nextstate = -1;
	condition = 1;
	question = "What can you tell me about Warrior's Grove?";
	text1 = "_I don't know what's going on outside these walls. However, considering the number of mutilated people that have been coming back lately, it must be unpleasant._";

begintalknode 29;
	state = 32;
	personality = 3;
	nextstate = -1;
	condition = 1;
	question = "I do not require any healing.";
	text1 = "_I am glad to hear it. If you ever do need to be healed, I will be here waiting. now, if you will excuse me, I must return to my prayers._";
	action = END_TALK;

begintalknode 31;
	state = -1;
	personality = 4;
	nextstate = 41;
	condition = 1;
	question = "Gonski";
	text1 = "You meet this shop's proprietor, a scarred, withered old man. His leathery skin shows the signs of many years under the sun, and his arms bear a number of long, thin scars.";
	text2 = "_I'm Gonski,_ he grunts. He is surrounded by a variety of newly made weapons and pieces of armor.";
	text5 = "Gonski looks like he wishes he was doing something else. He slowly passes a hammer from one hand to the other.";
	action = INTRO;

begintalknode 32;
	state = 41;
	personality = 4;
	nextstate = 42;
	condition = 1;
	question = "What do you sell here?";
	text1 = "He pats a nearby greatsword. _We got armor. We got weapons. We got shields. You can sell me your old stuff too._";

begintalknode 33;
	state = 42;
	personality = 4;
	nextstate = 43;
	condition = 1;
	question = "That's a nice greatsword.";
	text1 = "_Not for sale. We only got one, and it's mine. We got all sorts of weapons here. You'll need to be well equipped when you leave town._";

begintalknode 34;
	state = 43;
	personality = 4;
	nextstate = -1;
	condition = 1;
	question = "What is outside town?";
	text1 = "_There's plenty of monsters out there._ He snorts. _Probably too much for the likes of you. But if you want to have a chance, you want some of my weapons._";

begintalknode 35;
	state = 41;
	personality = 4;
	nextstate = -1;
	condition = 1;
	question = "Can I buy some weapons?";
	text1 = "You finish shopping.";
	code =
		begin_shop_mode("Gonski's Weapons","Gonski's weapons show signs of having been hastily made. There must be a high demand for blades around here. Considering what you had to fight through though, you're not surprised.",1,3,3);
	break;

begintalknode 36;
	state = 41;
	personality = 4;
	nextstate = -1;
	condition = 1;
	question = "Can I buy some armor?";
	text1 = "You finish shopping.";
	code =
		begin_shop_mode("Gonski's Armor","Gonski's armor shows dents and other signs of use. They may have already been used by less successful adventurers.",0,3,3);
	break;

begintalknode 39;
	state = 41;
	personality = 4;
	nextstate = -1;
	condition = 1;
	question = "Do you buy used equipment?";
	text1 = "He looks over your surplus goods. _A pretty decent lot. Still, I might be able to offer you a little for it._";
	text2 = "(You call sell items while on the store screen. An item has to be identified to sell it. To have items identified, find a sage (or one who works as such).";

begintalknode 42;
	state = -1;
	personality = 5;
	nextstate = 51;
	condition = 1;
	question = "Ella";
	text1 = "You walk up to the counter and look across at the innkeeper. She doesn't seem surprised to see adventurers in her bar.";
	text2 = "She smiles. _I'm Ella, owner of the Warrior's Arms. How may I help you?_";
	text5 = "Ella makes small talk with you and cleans the counter of the bar. _Do you need anything?_";
	action = INTRO;

begintalknode 43;
	state = 51;
	personality = 5;
	nextstate = 52;
	condition = 1;
	question = "What services do you offer?";
	text1 = "_We have all the things adventurers need. We can give you a room to rest in for the night, for only 5 coins. We have cheap rations available. And, of course, a tankard of beer is only a coin._";

begintalknode 44;
	state = 51;
	personality = 5;
	nextstate = -1;
	condition = 1;
	question = "Do a lot of adventurers pass through town?";
	text1 = "_Lots of them. Some of them even survive._";

begintalknode 45;
	state = 52;
	personality = 5;
	nextstate = -1;
	condition = 1;
	question = "I'll take a room for the night. (Pay 5 coins.)";
	text1 = "She shows you to your room and wishes you a pleasant night.";
	text3 = "She shakes her head. _Sorry, but that's 5 gold._";
	text5 = "You can't stay in an inn when on horseback.";
	action = INN 5 36 37;

begintalknode 46;
	state = 52;
	personality = 5;
	nextstate = -1;
	condition = 1;
	question = "I need some rations.";
	text1 = "You finish shopping.";
	code =
		begin_shop_mode("Fine Rations","The food at the inn is simple and edible. It's expensive though, probably because of high demand.",5,5,-1);
	break;

begintalknode 47;
	state = 52;
	personality = 5;
	nextstate = -1;
	condition = 1;
	question = "I would like some ale. (Pay 10 coins.)";
	text1 = "She serves up the ale. It's refreshing, if you like drinking horse urine!.";
	text3 = "_You call yourselves adventurers? How pathetic! You don't even have TEN gold pieces. Go out and kill something!_";
	code =
		clear_strings();
		if (coins_amount() < 10) 
			add_string(3);
			else {
				set_party_status(28,15,FALSE);								
				add_string(1);
				change_coins(-10);
				}
				
	break;

begintalknode 48;
	state = 52;
	personality = 5;
	nextstate = -1;
	condition = 1;
	question = "Anything special adventurers usually need?";
	text1 = "_Yes. Which reminds me, please bandage any wounds before going to your room. It costs a fortune to pay maids to clean the blood off the sheets._";

begintalknode 49;
	state = 52;
	personality = 5;
	nextstate = -1;
	condition = 1;
	question = "I don't need anything.";
	text1 = "_All right. When you do, we'll still be here. I hope._";
	action = END_TALK;

begintalknode 50;
state = 32;
nextstate = -1;
question = "_I wish to learn spells_";
text1 = "Mariann smiles. _Thank you for your time. I hope you have learned much_";
code =
	begin_shop_mode("Mariann's advanced spells.","Mariann's spells are of the highest levels. Truly amazing. However, they are more than dear.",8,6,-1);
	break;
